package com.lc.pianostudent.conn;

import com.lc.pianostudent.bean.AccessBean;
import com.lc.pianostudent.bean.ShopBean;
import com.lc.pianostudent.bean.ShopIndexBean;
import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2018/2/22.
 */
@HttpInlet(Conn.ORDER_INDEX)
public class PostOrderIndex extends BaseAsyPost {

    public String user_id;
    public PostOrderIndex(AsyCallBack asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected PostOrderIndexInfo parser(JSONObject object) throws Exception {
        if (object.optString("code").equals("200")) {

            PostOrderIndexInfo info = new PostOrderIndexInfo();

            JSONObject jsonObject = object.optJSONObject("data");

            info.order_number = jsonObject.optString("order_number");
            info.user_id = jsonObject.optString("user_id");
            info.money = jsonObject.optString("money");
            info.status = jsonObject.optString("status");

            TOAST = object.optString("message");
            return info;

        } else {

            TOAST = object.optString("message");

        }

        return null;
    }

    public static class PostOrderIndexInfo {

        public String order_number,user_id,money,status;
    }

}
